package goods

import (
	"context"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"
	pb "rpc/proto/goods"
	"rpc/server"
)

type ServerRet struct {
	pb.UnimplementedGoodsServer
}

func (s *ServerRet) GoodsCreate(ctx context.Context, in *pb.GoodsCreateReq) (*pb.GoodsCreateResp, error) {
	_, err := server.GoodCreate(in)
	if err != nil {
		return nil, status.Errorf(codes.Unimplemented, "method GoodsCreate not implemented")
	}
	return &pb.GoodsCreateResp{}, nil
}
func (s *ServerRet) DeleteGoods(ctx context.Context, in *pb.DeleteGoodsReq) (*pb.DeleteGoodsResp, error) {
	_, err := server.GoodsDelete(in)
	if err != nil {
		return nil, status.Errorf(codes.Unimplemented, "method DeleteGoods not implemented")
	}
	return &pb.DeleteGoodsResp{}, nil
}
func (s *ServerRet) GoodsList(ctx context.Context, in *pb.GoodsListReq) (*pb.GoodsListResp, error) {
	_, err := server.GetGoods(in)
	if err != nil {
		return nil, status.Errorf(codes.Unimplemented, "method DeleteGoods not implemented")
	}
	return &pb.GoodsListResp{}, nil
}
func (s *ServerRet) UpdateGoods(ctx context.Context, in *pb.UpdateGoodsReq) (*pb.UpdateGoodsResp, error) {
	_, err := server.UpdateGoods(in)
	if err != nil {
		return nil, status.Errorf(codes.Unimplemented, "method DeleteGoods not implemented")
	}

	return &pb.UpdateGoodsResp{}, nil

}
